
<!DOCTYPE html>

<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">


    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>登录</title>
    <link rel="stylesheet" href="/layui/css1/cgj1.css">
    <script src="/layui/layui.js"></script>
</head>

<body class="bg-gradient-primary">

<div class="container">

    <!-- Outer Row -->
    <div class="row justify-content-center">

        <div class="col-xl-10 col-lg-12 col-md-9">

            <div class="card o-hidden border-0 shadow-lg my-5">
                <div class="card-body p-0">
                    <!-- Nested Row within Card Body -->
                    <div class="row">
                        <div class="col-lg-6 d-none d-lg-block bg-login-image"></div>
                        <div class="col-lg-6">
                            <div class="p-5">
                                <div class="text-center">
                                    <h1 class="h4 text-gray-900 mb-4">实验室预约管理系统</h1>
                                </div>
                                <span id="message"></span>
                                <form class="user" action="" method="post" name="MyForm" id="login1">
                                    <div class="form-group">
                                        <input type="text" class="form-control form-control-user" id="login_account" name="login_account" placeholder="请输入账号" required="required">
                                    </div>
                                    <div class="form-group">
                                        <input type="password" class="form-control form-control-user" id="login_pwd" name="login_pwd" placeholder="请输入密码" required="required">
                                    </div>

                                    <font color="red"></font>
                                    <button  class="btn btn-primary btn-user btn-block"lay-submit lay-filter="loginn" id="login" onClick="javascript:loginn()">登录</button>
                                    <hr>
                                </form>
                                <hr>

                                <div class="text-center">
                                    <a class="small" href="login">用户登陆</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    function loginn() {
        layui.use(['jquery','form'],function(){
            var $=layui.jquery;
            var form = layui.form;


            form.on('submit(loginn)', function(data){

                //提交表单数据
                $.ajax({
                    url:"/admin/logina",
                    type: "POST",
                    dataType:"JSON",
                    //data:data.field,

                    data:{"loginName":$("#login_account").val(),"password":$("#login_pwd").val()},
                    success:function (ret) {
                        if(ret.code==0){
                            window.location.href = '/showindex1';
                        }else
                        {
                            $("#message").html(ret.msg);

                        }

                    }
                })
                return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
            });
        });


    }

</script>
</html>